class Wallnut extends GuaAnimation {
    static new(game) {
        let p = new this(game, animationWallnut)
        p.setup()
        return p
    }

    setup() {
        // row表示在草地的第几排
        this.row = -1
        this.cooldown = 5
        this.score = 50
        this.hp = 100
    }

    remove() {
        this.scene.removeOther(this)
    }

    cracked() {
        this.hp--
        log('this.hp', this.hp)
        if (this.hp > 30 && this.hp < 60) {
            this.changeAnimation('cracked1')
        }
        if (this.hp < 30) {
            this.changeAnimation('cracked2')
        }
        if (this.hp ==0){
            this.remove()
        }
    }

    update() {
        super.update()
        // this.cracked()
    }
}